//
//  NRWTabBarController.m
//  NRWMall
//
//  Created by 邢毅 on 2018/5/7.
//  Copyright © 2018年 com.anpxd. All rights reserved.
//

#import "NRWTabBarController.h"

@interface NRWTabBarController ()

@end

@implementation NRWTabBarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.setTabBarTitleColor(getColor(@"#FF6C00"), UIControlStateSelected)
    .setTabBarTitleColor(getColor(@"#4D4D4D"), UIControlStateNormal);
    
    self.tabBar.tintColor = getColor(@"FF6C00");
}

- (void)addChildViewController:(UIViewController *)childController title:(NSString *)title image:(NSString *)imageName selectImage:(NSString *)selectImage {
    
    childController.title = title;
    if (imageName) {
        
        childController.tabBarItem.image = [[UIImage imageNamed:imageName] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    }
    if (selectImage) {
        
        childController.tabBarItem.selectedImage = [[UIImage imageNamed:selectImage] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    }
    
    [self addChildViewController:childController];
}

@end
